// ActionScript file
package
{
	public class dbCon
	{
		
	import com.maclema.mysql.*;
	import mx.utils.StringUtil;
	import flash.system.Security;
	public static var con:Connection=null;
	
	
	public static function getConnection():Connection {
			//sAction = val;			
			if (con == null || con.connected == false) {
				//Security.loadPolicyFile("http://babyrose.sfunzy.com/crossdomain.xml");
				Security.loadPolicyFile("xmlsocket://211.43.210.79:843");
				Security.allowDomain("*");		 
		        con = new Connection("211.43.210.79", 13306, "sfunzy", "sfunzy@))*", "sfunzy");        
		        //con.addEventListener(Event.CONNECT, handleConnected);        
		        con.connect();
		       	trace("con.connected : " + con.connected);
	        	return con;	        
		 	}else {
		 		trace("already connection..");
		 		//var e:Event = new Event(Event.CONNECT);
		 		//handleConnected(e);
		 	}
			trace("con.connected : " + con.connected);		 	
	        return con;
	}		
	}
}